namespace BM.Tools.WebControls.MForm.Navigation.XPath.NodeTests
{
    using System;

    /// <summary>
    /// A definition of a node test that matches all children nodes in the specified namespace.
    /// </summary>
    public class AllInNamespaceTest : NodeTest
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="AllInNamespaceTest"/> class. 
        /// </summary>
        /// <param name="prefix">
        /// The prefix.
        /// </param>
        public AllInNamespaceTest(string prefix)
        {
            Prefix = prefix;
        }

        /// <summary>
        /// Gets or sets Prefix.
        /// </summary>
        /// <value>
        /// The prefix.
        /// </value>
        public string Prefix
        {
            get;
            set;
        }

        /// <summary>
        /// Gets the text representation of the node test.
        /// </summary>
        /// <value>
        /// The text in which the node test can be represented in xpath - (prefix):*.
        /// </value>
        public override string Text
        {
            get
            {
                return String.Concat(Prefix, ":*");
            }
        }
    }
}